fix(call): restore Bluetooth audio routing - #6567
Conversation
Prefer call-capable Bluetooth communication devices and preserve selection across reconnects. Assisted-by: Codex:gpt-5 Signed-off-by: Oleg Cherry <80347136+flake92@users.noreply.github.com>
2a60dbe to
97bb606
Compare
Assisted-by: Codex:gpt-5 Signed-off-by: Oleg Cherry <80347136+flake92@users.noreply.github.com>
|
Thank you for contributing @flake92 🙏 It would be great if the new java class could be converted to kotlin. Just let us know if you want to do this (that would be awesome!) or if we should take over. Claude AI review: Correctness (4 findings)
Efficiency/simplification/reuse (6 findings) — lower severity: exhausted retries keep re-triggering startScoAudio() harmlessly forever; the legacy vs. Android-12+ paths are interleaved via SDK-version branches across ~11 call sites instead of being split behind an interface (real maintenance risk going forward); some duplicated device-enumeration logic between WebRtcAudioManager and ModernBluetoothRoute; one dead code branch; one needless one-line wrapper. The two "removed behavior" concerns I'd have flagged up front — un-stickying Bluetooth selection on disconnect, and a possible SCO_DISCONNECTING race in requestBluetoothAudioSelection() — were investigated and ruled out: the first is the intentional point of the fix, the second self-heals within the 4s timeout. Given this is call-audio-routing code (hard to unit test end-to-end, easy to regress silently), I'd suggest at minimum fixing the first two correctness findings before merging, and manually testing the "switch away from Bluetooth mid-call" and "notification during a Bluetooth call" paths on a real device. |
Prefer call-capable Bluetooth communication devices and preserve selection across reconnects.
Assisted-by: Codex:gpt-5
🖼️ Screenshots
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)